package com.lpl.web.controllers;

import com.lpl.polo.*;
import com.lpl.service.getxing;
import com.lpl.service.loginin;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/lun")
public class getxainfg {
    @Autowired
    private com.lpl.service.getxing getxing;

    //插入
    @PostMapping("/jia")
    public result getCode(@RequestBody xaing lunxaing){
        result res= getxing.insterxiang(lunxaing);
        return result.success("插入成功！");

    }

    //获取

    @GetMapping("/getlun")
    public result getlun(){
        List<xaing> res= getxing.getxiang();

        return result.success(res);
    }

    @PostMapping("/tilun")
    public result tilun(@RequestBody conter conter){


        result res= getxing.tixiang(conter);


        return result.success(res);
    }

    @GetMapping("/getlunx")
    public result getlunx(int id){
        System.out.println(id);
        List<conter> res= getxing.getlunxiang(id);
        System.out.println(res);

        return result.success(res);
    }

}


